// 主界面
;define(function(require, exports, module) {
    'use strict';
    var util = require("util");
    var base = require(CONFIG.BasePath + "js/enterprise/base");
    var router = require("../hash/pageRouter");
    var constant = require("constant");
    var css_letter = require("./inquireLogisticsInfoMain.css");
    var databind = require("databind");
    var tools = require("tools");
    
    var init = function(){
    	router.init();
		initEvent();
    };
    
	var initEvent = function(){
		if(base.getData("sid")==null){
			location.href="../login/login.html";
		}
		
		tools.requireInput($("#inquireLogisticsInfoMain"));
		
		$("#inquireLogisticsInfoMain").on("click", "#inquireLogisticsBtn", function(){
			var caseNumber = $("#inquireLogisticsInfoMain .caseNumber").val();
			var waybillNumber = $("#inquireLogisticsInfoMain .waybillNumber").val();
			var financeNumber = $("#inquireLogisticsInfoMain .financeNumber").val();
			if(waybillNumber==""){
				base.alert(2, "请输入运单号！");
			}else{
				router.route("account/inquireLogisticsInfoDetail.html?caseNumber="+caseNumber+"&waybillNumber="+waybillNumber+"&financeNumber="+financeNumber);
			}
		});
    };
    
	//查询融资箱货物流明细
    var inquireContainerInventoryTrackingDetail = function(dom){
		base.fnAjax({
			action: "inquireContainerInventoryTrackingDetail.json",
			async: false,
			oData: {
				inventoryId: $(dom).parents("dd").attr("inventoryId")
//				inventoryId: 102
            }, //传递参数
            fnSuccess: function(data) {
                if (data.status == 200) {
                	var tpl = tplDetail;
                	var html = juicer(tpl, data);
                	$(dom).parents("dd").find(".order_detail").html(html);
                } else {
                }
            }
		});
	};
	
    return {
        init:init
    };
});